Using a Variable within multiple Actions

Within a composite quick action, you can re-use a variable from an earlier action in a subsequent later action.

In this example, the three actions, that constitute the composite action, do the following:

  • Action 1: A variable is created containing the text "Incident cloned by" followed by the name of the current user.

  • Action 2: The selected Incident is cloned, the Symptom field retains its existing content and the action adds a new line, and then inserts the variable value which states who cloned the incident.

  • Action 3: The final action sends an email to the team telling them that the Incident has been cloned and by whom.

To use a variable in multiple actions within a Composite Quick Action:

  1. Create the variable within a new composite action as described in Creating a Quick Action Variable.

    In our example, as shown below, the variable is called ClonedByUserMessage, is of type Text and contains a value of $("Incident cloned by "+CurrentUserDisplayName()).

  2. Note: Variables are created within a composite quick action and can only be used within that ONE composite action, and not in other actions or elsewhere withinITSM.

  3. For the second action, select Clone Object from the Add new action dropdown list. Select .

  4. For Field Name, select Symptom (Description).

  5. For the first part of Field Value, select fx and then search for Symptom in the Toolbox Search field on the right-hand side.

  6. Drag or double-click to add the Symptom field to your expression.
  7. Remove the Symptom search term from the box so that the menus appear underneath, then drag or double-click your previously created variable ClonedByUserMessage from the Variables menu.

  8. Tip: Add an "/r/n" in between the description and the variable to insert a new line in the contents of the Symptom field if desired.

    Note: If no variables have been defined within your composite action, you won't see a variables folder in the Toolbox.

  9. For the third and final action, select Send Email from the Add new action dropdown. Select .

  10. Complete the fields for Log in Journal, From:, To:, and Subject:, and then change any settings on the right-hand-side in the Action Settings tab.

  11. Select the Insert a Function tab and drag over the ClonedByUser Message variable into the body of the email.

  12. Select Save to save all three actions in one composite action.

  13. To run your composite action, go to an Incident in a Service Desk dashboard and select More > No category > Name of Composite Action.

  14. After cloning is completed, you see Incident cloned by [current user] in the Description field.